adalt

Read about adalt, The latest news, videos, and discussion topics about adalt from alibabacloud.com

Implement small site ad management with PHP (Revised edition)

; $query = "INSERT into AD (URL, alt, priority, banner) VALUES (' $url ', ' $alt ', ' $priority ', ' $banner _name ')"; Insert Success Displays the following information; $try =mysql_query ($query); if ($try) { echo "A new ad is completed, details:"; echo ""; echo "AD site: $url Advertising Link Description: $alt Display weighting: $priority "; }else{echo "Error";} } }else{ ?> showad.php******************** ? Include ("Config.inc"); $query = "Select URL, banner, ALT, priority from AD"; $r

Implement small site advertisement management with PHP

"; Result=mysql_db_query ("Guanggao", query); Numrows=mysql_num_rows (result); Use the Mysql_fetch_object () function to obtain useful column information and coexist in the corresponding array; while (row = mysql_fetch_object (result)) { adurl[]= row->url; adbanner[]= row->banner; adalt[]= row->alt; adpriority[]= row->priority; } initialization of intermediate variables; Numcheck= NumRows; I= pricount=0; The maximum random number is obtained. while (N

Use PHP to implement small site advertisement management (revised version) _ PHP Tutorial

corresponding array; While ($ row = mysql_fetch_object ($ result )){ $ Adurl [] = $ row-> url; $ Adbanner [] = $ row-> banner; $ Adalt [] = $ row-> alt; $ Adpriority [] = $ row-> priority; } // Initialize the intermediate variable; $ Numcheck = $ numrows; $ I = $ pricount = 0; // Obtain the maximum random number; While ($ numcheck ){ $ Pricount + = $ adpriority [$ I]; $ I ++; $ numcheck --; } // Random seed is generated every one minute during progra

Small site advertisement management using PHP

array. add the weights of all ads to get the maximum random number. each time you load the page, use srand () generate a random tree seed, use the rand () function to generate a random number from 1 to the maximum random number, and then randomly display different advertising lines according to certain rules, the larger the weight, the larger the chance to be displayed. # ShowAd. php3 -- randomly display advertisements # // Select a database for connection; Connection = mysql_connect (); Mysql

Small site advertisement management using PHP

#// Select a database for connection;Connection = mysql_connect ();Mysql_select_db ("guanggao", connection );// Execute the query to obtain the number of ads;Query = "select URL, banner, ALT, priority from ad where priority> 0 ";Result = mysql_db_query ("guanggao", query );Numrows = mysql_num_rows (result );// Use the mysql_fetch_object () function to obtain useful column information and store it in the corresponding array;While (ROW = mysql_fetch_object (result )){Adurl [] = row-> URL;Adbanner

Using PHP to implement small site advertising Management (revised version) _php Foundation

; $query = "INSERT into AD (URL, alt, priority, banner) VALUES (' $url ', ' $alt ', ' $priority ', ' $banner _name ')"; Insert Success Displays the following information; $try =mysql_query ($query); if ($try) { echo "A new ad is completed, details:"; echo ""; echo "AD site: $url Advertising Link Description: $alt Display weighting: $priority "; }else{echo "Error";} } }else{ ?> showad.php******************** ? Include ("Config.inc"); $query = "Select URL, banner, ALT, priority from AD"; $r

Use PHP to manage small-sized website ads (revised version)

, banner) values ('$ url',' $ alt ',' $ priority ',' $ banner_name ')";// If the insert operation is successful, the following information is displayed;$ Try = mysql_query ($ query );If ($ try ){Echo "An advertisement has been added. Details :";Echo "";Echo "advertisement URL: $ URLAd Link Description: $ altShow weighting: $ priority ";} Else {echo "error ";}}} Else {?> * ************** Showad. php ******************** Include ("config. Inc ");$ Query = "select URL, banner, ALT, pr

Use PHP to manage small-sized website ads (revised version)

obtain useful column information and store it in the corresponding array; While ($ row = mysql_fetch_object ($ result )){ $ Adurl [] = $ row-> url; $ Adbanner [] = $ row-> banner; $ Adalt [] = $ row-> alt; $ Adpriority [] = $ row-> priority; } // Initialize the intermediate variable; $ Numcheck = $ numrows; $ I = $ pricount = 0; // Obtain the maximum random number; While ($ numcheck ){ $ Pricount = $ adpriority [$ I]; $ I; $ numcheck --; } // Random

Small-sized website advertisement management with PHP _ PHP Tutorial

generate a random number from 1 to the maximum random number, and then randomly display different advertising lines according to certain rules, the larger the weight, the larger the chance to be displayed. # ShowAd. php3 -- randomly display advertisements # // Select a database for connection; Connection = mysql_connect (); Mysql_select_db ("guanggao", connection ); // Execute the query to obtain the number of ads; Query = "SELECT url, banner, alt, priority FROM ad where priority> 0 "; Result

Use PHP to manage small-sized website ads (revised version)

information and store it in the corresponding array; While ($ row = mysql_fetch_object ($ result )){ $ Adurl [] = $ row-> url; $ Adbanner [] = $ row-> banner; $ Adalt [] = $ row-> alt; $ Adpriority [] = $ row-> priority; } // Initialize the intermediate variable; $ Numcheck = $ numrows; $ I = $ pricount = 0; // Obtain the maximum random number; While ($ numcheck ){ $ Pricount = $ adpriority [$ I]; $ I; $ numcheck --; } // Random seed is generated eve

Small site advertisement management using PHP

displayed. # ShowAd. php3 -- randomly display advertisements # // Select a database for connection; Connection = mysql_connect (); Mysql_select_db ("guanggao", connection ); // Execute the query to obtain the number of ads; Query = "SELECT url, banner, alt, priority FROM ad where priority> 0 "; Result = mysql_db_query ("guanggao", query ); Numrows = mysql_num_rows (result ); // Use the mysql_fetch_object () function to obtain useful column information and store it in the corresponding array; W

Use PHP to manage small-sized website ads (revised version)

) values ('$ url',' $ alt ',' $ priority ',' $ banner_name ')";// If the insert operation is successful, the following information is displayed;$ Try = mysql_query ($ query );If ($ try ){Echo "An advertisement has been added. Details :";Echo "";Echo "advertisement url: $ urlAd Link Description: $ altShow weighting: $ priority ";} Else {echo "error ";}}} Else {?>* ************** Showad. php ********************Include ("config. inc ");$ Query = "SELECT url, banner, alt, priority from ad ";$ Resul

Using PHP to realize the _php foundation of small site advertisement management

number of ads; query= "Select URL, banner, ALT, priority from AD where priority > 0"; Result=mysql_db_query ("Guanggao", query); Numrows=mysql_num_rows (result); Use the Mysql_fetch_object () function to obtain useful column information and coexist in the corresponding array; while (row = mysql_fetch_object (result)) { adurl[]= row->url; adbanner[]= row->banner; adalt[]= row->alt; adpriority[]= row->priority; } initialization of intermediate variable

Implementing small site advertisement management with Php+mysql

", query);Numrows=mysql_num_rows (result);Use the Mysql_fetch_object () function to obtain useful column information and coexist in the corresponding array;while (row = mysql_fetch_object (result)) {adurl[]= row->url;adbanner[]= row->banner;adalt[]= row->alt;adpriority[]= row->priority;}initialization of intermediate variables;Numcheck= NumRows;I= pricount=0;The maximum random number is obtained.while (Numcheck) {pricount+= adpriority[i];i++; numcheck

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.